Initialize 'un-initialized' vars detected by valgrind.
authoroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 19 Apr 2006 21:41:37 +0000 (21:41 +0000)
committeroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Wed, 19 Apr 2006 21:41:37 +0000 (21:41 +0000)
gpsbabel/hsa_ndv.c
gpsbabel/mkshort.c

index 92a91fb478af4178f142620c0acaf0bf3ff92bf5..7b680b3e60b49d8b764879e927d2a20e57548274 100644 (file)
@@ -228,6 +228,7 @@ hsa_ndv_read(void)
        {
                char *bad;
 
+               buf[len] = 0;
                if (NULL != strstr(buf, "nver=1"))
                {//its the older format, not xml
                        fseek(fd, 0, SEEK_SET);
index d99d28bcb5e0139d37dc4f22a1b092ac12d3b505..5949c0d751b7a1f9898ecd6e92ed699a5c11acff 100644 (file)
@@ -481,7 +481,10 @@ mkshort(short_handle h, const char *istring)
         */
        if ( hdl->target_len < 15) {
                replaced = 1;
+       } else {
+               replaced = 0;
        }
+       
        while (replaced && strlen(ostring) > hdl->target_len) {
                ostring = delete_last_vowel(2, ostring, &replaced);
        }